package com.zipking.cloud.springbootmybatis.util.excel;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.zipking.cloud.springbootmybatis.util.JsonUtil;

import java.util.HashMap;

public class MyExcelUtil {
    /**
     * 获取 header
     *
     * @param obj 通用对象
     * @return 对象属性数组
     */
    public static String[] getHeader(Object obj)  {
        String jsonString = JsonUtil.toStr(obj);
        HashMap<String, Object> objectMap = (HashMap<String, Object>) JsonUtil.toObj(jsonString, HashMap.class);
        return objectMap.keySet().toArray(new String[objectMap.keySet().size()]);
    }


}
